package com.zzty.txj1.service.impl;

import com.zzty.txj1.dao.GroupMapper;
import com.zzty.txj1.entity.Group;
import com.zzty.txj1.service.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GroupServiceImpl implements GroupService {

    @Autowired
    GroupMapper groupMapper;

    @Override
    public Integer setGroup(String userName1, String userName2,Integer clazzId) {
        System.out.println("userName1 & userName2 & clazzId: "+userName1+" "+userName2+" "+clazzId);
        Integer count=groupMapper.setGroup(userName1,userName2,clazzId);
        return count;
    }

    @Override
    public List<Group> getGroup(Integer clazzId) {
        List<Group> groups=groupMapper.getGroup(clazzId);
        System.out.println("groups: "+groups.toString());
        return groups;
    }

    @Override
    public Integer deleteGroup(Integer groupId) {
        Integer count=groupMapper.deleteGroup(groupId);
        return count;
    }


//    @Override
//    public List<User> getUser2ById(User user) {
//        List<User> users=groupMapper.getUser2ById(user);
//        return users;
//    }
}
